<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.List" %>
    <%@ page import="java.util.ArrayList" %>
    <%@ page import="com.DAO.UserDaoImpl" %>
    <%@ page import="com.bean.User" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>管理信息</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
  <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="page-header" style="margin:0;padding:0">
    <h1>欢迎欢迎，管理员
    </h1>
	</div>
	<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
    <div class="navbar-header">
        <a class="navbar-brand" href="#">管理员</a>
    </div>
    <div>
        <ul class="nav navbar-nav">
            <li><a href="manage.jsp">管理用户</a></li>
            <li><a href="manageTie.jsp">管理帖子</a></li>
             <li><a href="LoginOffServlet">退出登录</a></li>
        </ul>
    </div>
    </div>
</nav>
<table class="table">
  <caption>基本的表格布局</caption>
  <thead>
    <tr>
      <th>ID</th>
      <th>用户名</th>
      <th>手机号</th>
      <th>邮箱</th>
      <th>用户类型</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
 	<%
 		UserDaoImpl user = new UserDaoImpl();
 		List<User> userinfor = user.findAllUser();
 		if(userinfor==null || userinfor.size()<1){
 	%>
 		<div>暂无数据</div>
 	<%}else{ 
 		for(User userinformation:userinfor){
 	%>
 		<tr>
 			<td><%=userinformation.getUserID() %></td>
 			<td><%=userinformation.getUsername() %></td>
 			<td><%=userinformation.getUserphone() %></td>
 			<td><%=userinformation.getUseremail() %></td>
 			<td><%=userinformation.getUsertype() %></td>
 			<td><a href="http://localhost:8080/publishTie/DeleteUser?id=<%=userinformation.getUserID() %>">删除</a></td>
 		</tr>
 	<%} }%>
  </tbody>
</table>
</body>
</html>